﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BoAddonBiz_FreightForwarder.Cost
{
    /// <summary>
    /// 费用项检索条件
    /// </summary>
    public class Condition
    {
        public Condition()
        {
        }
        public Condition(string Alias,string Value,ConditionOperation operation,ConditionRelationship Relationship,bool IsEqualAlias=false)
        {
            this.m_Alias = Alias;
            this.m_CondVal = Value;
            this.m_Operation = operation;
            this.m_Relationship = Relationship;
            this.m_IsEqualOtherAilas = IsEqualAlias;
        }
        private string m_Alias;
        /// <summary>
        /// 字段
        /// </summary>
        public string Alias
        {
            get { return m_Alias; }
            set { m_Alias = value; }
        }
        private string m_CondVal;
        /// <summary>
        /// 字段值
        /// </summary>
        public string CondVal
        {
            get { return m_CondVal; }
            set { m_CondVal = value; }
        }
        private ConditionOperation m_Operation = ConditionOperation.co_EQUAL;
        /// <summary>
        /// 条件
        /// </summary>
        public ConditionOperation Operation
        {
            get { return m_Operation; }
            set { m_Operation = value; }
        }
        private ConditionRelationship m_Relationship = ConditionRelationship.cr_NONE;
        /// <summary>
        /// 关系
        /// </summary>
        public ConditionRelationship Relationship
        {
            get { return m_Relationship; }
            set { m_Relationship = value; }
        }

        private bool m_BracketOpenNum = false;
        /// <summary>
        /// 括号（
        /// </summary>
        public bool BracketOpenNum
        {
            get { return m_BracketOpenNum; }
            set { m_BracketOpenNum = value; }
        }

        private bool m_BracketCloseNum = false;
        /// <summary>
        /// 括号）
        /// </summary>
        public bool BracketCloseNum
        {
            get { return m_BracketCloseNum; }
            set { m_BracketCloseNum = value; }
        }
        private bool m_IsEqualOtherAilas = false;
        /// <summary>
        /// 是否字段间比较
        /// </summary>
        public bool IsEqualOtherAilas
        {
            get { return m_IsEqualOtherAilas; }
            set { m_IsEqualOtherAilas = value; }
        }
    }
    /// <summary>
    /// 操作符
    /// </summary>
    public enum ConditionOperation
    {
        co_EQUAL,
        co_LIKE,
        co_GRATER_THAN,
        co_LESS_THAN,
        co_GRATER_EQUAL,
        co_LESS_EQUAL,
        /// <summary>
        /// 不等于
        /// </summary>
        co_Not_EQUAL
    }
    /// <summary>
    /// 关系
    /// </summary>
    public enum ConditionRelationship
    {
        cr_NONE,
        cr_AND,
        cr_OR
    }
}
